<h1>Listing topics</h1>
<div id="product-list">
  <h1> 帖子列表 </h1>
  <%= link_to 'New topic', :action=>"new" %>
  <table>
  <% for topic in @topics %>
    <tr class="<%=  cycle('list-line-odd','list-line-even') %>"
        <td>
        </td>
        <td class="list-description">
           <dt><b>编号:</b><%=h topic.id%>
             <b>发帖人:</b><%=h topic.user_id%></dt>
           <dt><b>标题：</b><%=h topic.title%></dt>
           <dt><b>正文：</b><%=h truncate(topic.topic_content.gsub(/<.*?>/,''),
                  :length =>80) %>
          </dt>             
           
         </td>
          <td class="list-actions">
            <%= link_to 'show', :action=>"show", :id=>topic.id %>
            <%= link_to 'edit',:action=>"edit",:id=>topic.id%>
            <%= link_to 'destroy',:action=>"destroy",:id=>topic.id%>
          </td>
    </tr>
<% end %>
  </table>

</div>




